package com;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;

/**
 * @BelongsProject: my
 * @BelongsPackage: com
 * @Author: ji ge
 * @CreateTime: 2024-02-05  21:35
 * @Description: TODO
 * @Version: 1.0
 */
public class MyRule {

    @Bean
    public IRule myRule() {
        // 此处将ribbon默认使用的轮询策略改为随机策略
        return new RandomRule();
    }
}


